package com.test.action;


import java.util.List;


import com.opensymphony.xwork2.ActionContext;
import com.test.base.BaseAction;
import com.test.domain.Forum;
import com.test.domain.Topic;
/**
 * 版块
 * @author Administrator
 *
 */
public class ForumAction extends BaseAction<Forum>{
	private static final long serialVersionUID = 1L;
	public String list(){
		List<Forum> forumList = forumService.findAllForum();
		ActionContext.getContext().put("forumList", forumList);
		return "list";
	}
	public String show(){
		System.out.println("操你妈的id是多少："+model.getId());
		Forum forum = forumService.findForumById(model.getId());
		if(forum==null){
			System.out.println("你妈炸了，竟然是空的");
		}else{
			System.out.println("版块名称："+forum.getName());
		}
		ActionContext.getContext().put("forum", forum);
		if(topicService==null){
			System.out.println("Action中的topicService都为空！");
		}else{
			System.out.println("topciService 没问题！");
		}
		List<Topic> topicList = topicService.findTopicByForum(forum);
		if(topicList==null){
			System.out.println("我是大傻逼！");
		}else{
			System.out.println("着一定第页面的问题~");
		}
		ActionContext.getContext().put("topicList", topicList);
		return "show";
	}
}
